import axios from 'axios'
import { Toast } from 'vant'

axios.defaults.baseURL = 'http://112.74.99.5:3000/web/api'
axios.interceptors.request.use(function (config) {
  Toast('success')
  return config
}, function (error) {
  return Promise.reject(error)
})

axios.interceptors.response.use(function (response) {
  return response
}, function (error) {
  Toast(error.message)
  return Promise.reject(error)
})

export default axios
